package com.lan.springbootdruid.mapper;

import com.lan.springbootdruid.datasource.TargetDataSource;
import com.lan.springbootdruid.entity.User;
import com.lan.springbootdruid.enums.DataSourceKey;
import org.springframework.stereotype.Repository;

/**
 * @author: Lan
 * @date: 2019/5/5 18:26
 * @description:
 */
@Repository
public interface UserMapper {

    /**
     * 通过ID获取用户对象
     *
     * @param id
     * @return
     */
    @TargetDataSource(dataSourceKey = DataSourceKey.DB_OTHER)
    User getUserById(int id);

    /**
     * 通过id修改用户名
     *
     * @param id
     * @return
     */
    @TargetDataSource(dataSourceKey = DataSourceKey.DB_OTHER)
    int updateUserName(int id);
}
